import { User } from "#/entity"
// import { AgreementType } from "../types/enum"

interface Operation {
  entity: {
    entity: string;
    name: string;
    module: {
      module: string;
      name: string;
    };
  };
  code: string;
  name: string;
}
interface Permission {
  id: number;
  name: string;
  module: {
    module: string;
    name: string;
  };
  isImmutable: boolean;
}
export namespace IGetCommon {
  // 查询快递公司
  export interface ReqLogisticsInfo {
    number: string
  }
  // 日志列表
  export interface ReqLogList {
    module: string
    entity: string
    entityId: string
  }
  export interface ReqParams {
    module?: string
    entity: string
    entityId?: string
  }
  // 参数详情
  export interface ReqParamsDetail {
    key: string
  }
  // 上传图片
  export interface ReqData {
    group?: string
    path?: string
    jobNumber?: string
    file: string
  }
  // 图片返回信息
  export interface ResData {
    success: string
    url?: string
  }
  // 图片返回信息
  export interface misResData {
    success: string
    url?: {
      busType: string
      businessId: string
      createBy: string
      createDate: string
      id: string
      name: string
      path: string
      serverUrl:string
    }
  }
  // 操作日志
  export interface ResLog {
    id: string
    module: string
    entity: string
    entityId: number
    attachments: string
    operator: User
    major: string
    action: string
    memo: string
    createAt: string
  }
  // 参数详情
  export interface ResParams {
    [key: string]: string
  }
  // 领导列表
  export interface ResLeader {
    id: string
    sort: number
    portrait: string
    avatar: string
    name: string
    contacts: string
    parent: any
    positionCode: string
    realName: string
    positions: {
      id: string
      name: string
    }[]
    createBy: {
      id: number
      name: string
    }
    createAt: string
  }
  export interface ResLeaderList {
    data: ResLeader[]
    total: number
  }
  // 获取协议内容
  export interface ReqAgreementContent {
    type: string
  }
  export interface ResAgreementContent {
    id: string
    type: {
      id: string
      key: string
      sort: number
      typeId: string
      value: string
    }
    content: string
    createBy: {
      id: number
      name: string
    }
    category: {
      id: string,
      typeId: string,
      key: string,
      sort: number,
      value: string
    }
  }
  // 权限列表
  export interface ResPermissionList {
    id: number
    permission: Permission
    operation: Operation
    createAt: string
  }
  // 获取字典列表
  export interface ReqDictionariesList {
    typeKey: string
    status: boolean
  }
  export interface ReqDictionariesQxtList {
    keys: string
  }
  export interface ResDictionariesList {
    id: string
    typeId: string
    key: string
    sort: number
    status: boolean
    system: boolean
    value: string
    createBy: {
      id: number
      name: string
    },
    createAt: string
    updateBy: {
      id: number
      name: string
    }
  }
  // 查询快递公司
  export interface ResLogisticsInfo {
    comCode: string
    lengthPre: number
    name: string
  }
  // 日志列表
  export interface ResLogList {
    id: string
    module: string
    entity: string
    entityId: number
    operator: {
      id: number
      name: string
      portrait: string
      mobile: string
    },
    major: string
    action: string
    memo: string
    createAt: string
  }
  // 快递100查询
  export interface ResExpressInfo {
    com: string
    condition: string
    isLoop: boolean
    ischeck: string
    message: string
    nu: string
    routeInfo: { from: { number: string, name: string }, to: { number: string, name: string } }
    data: {
      areaCenter?: string
      areaCode?: string
      areaName?: string
      areaPinYin?: string
      context: string
      ftime: string
      location: string
      status: string
      statusCode: string
      time: string
    }[]
    state: string
    status: string
  }
}
